﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using DataMining.Properties;

namespace DataMining.DataAccess
{
    public  class MyConnection
    {
        private  SqlConnection sqlConnection2 = null;

        /// <summary>
        /// 存入目标数据库
        /// </summary>
        /// <param name="conn"></param>
        /// <returns></returns>
        public  SqlConnection getSqlConnection2()
        {
            if (sqlConnection2 == null)
            {
                Settings setting = new Settings();
                sqlConnection2 = new SqlConnection();
                //sqlConnection.ConnectionString = "Data Source=ERPLAB-E2BCCC62;Initial Catalog=hospital;User ID=erplab;Password=erplab";
                //sqlConnection.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=hospital;Integrated Security=True";
                //sqlConnection.ConnectionString = "Data Source=PC-200903311632;Initial Catalog=hospitalTest;Integrated Security=True";
               // sqlConnection2.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=hospitalTest;Integrated Security=True";
               // sqlConnection2.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=DataWareHouse;Integrated Security=True";
                sqlConnection2.ConnectionString = "Data Source=PC-200909251312;Initial Catalog=DataWareHouseTest;User ID=sa;Password=sa";

                // sqlConnection2.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=DataWareHouseTest;User ID=sa;Password=sa";
                return sqlConnection2;
            }
            else
                return sqlConnection2;
        }

        public  void Dispose()
        {
            if (sqlConnection2 != null)
                sqlConnection2.Dispose();
        }


    }
}
